package com.up2566.demo.model;

import java.math.BigDecimal;

/**
 * 动态收益model
 *
 * @author up
 * @date 2021/1/11
 */
public class DynamicInitDataModel {

    /**
     * 踏日比率
     */
    private BigDecimal ta;

    /**
     * 影子比率
     */
    private BigDecimal ying;

    /**
     * 卷云比率
     */
    private BigDecimal juan;

    public DynamicInitDataModel init(Float gjPro) {
        // TODO 不能很好的用程序模拟非线性函数收益,故采用分段方式计算大致收益,需保存更新 up 2021/8/14
        if (gjPro >= 1200) {
            ta = new BigDecimal("1.976");
            ying = new BigDecimal("2.260");
            juan = new BigDecimal("4.788");
        } else if (gjPro >= 1100) {
            ta = new BigDecimal("1.98");
            ying = new BigDecimal("2.262");
            juan = new BigDecimal("4.798");
        } else if (gjPro >= 1000) {
            ta = new BigDecimal("1.988");
            ying = new BigDecimal("2.267");
            juan = new BigDecimal("4.8129");
        } else if (gjPro >= 900) {
            ta = new BigDecimal("1.993");
            ying = new BigDecimal("2.273");
            juan = new BigDecimal("4.8288");
        } else if (gjPro >= 800) {
            ta = new BigDecimal("1.996");
            ying = new BigDecimal("2.278");
            juan = new BigDecimal("4.8395");
        } else if (gjPro >= 700) {
            ta = new BigDecimal("2.0");
            ying = new BigDecimal("2.283");
            juan = new BigDecimal("4.8554");
        } else if (gjPro >= 600) {
            ta = new BigDecimal("2.01");
            ying = new BigDecimal("2.292");
            juan = new BigDecimal("4.8823");
        } else {
            ta = new BigDecimal("2.02");
            ying = new BigDecimal("2.23");
            juan = new BigDecimal("4.9");
        }
        return this;
    }

    public BigDecimal getTa() {
        return ta;
    }

    public BigDecimal getYing() {
        return ying;
    }

    public BigDecimal getJuan() {
        return juan;
    }
}
